$(function(){
	
	var sMenu =$("#sMenu").val();
	var mMenu = $("#mMenu").val();
	var mmMenu = $("#mmMenu").val();
	var basePath = $("#basePath").val();
	var kindurl = basePath +"view/TraderBook_BookKind/showBookKinds";
	var url = basePath +"view/";
	var url1 =url + "/TraderBook_Index/TraderBook_Index";
	var url2="";
	var url3 = "";
	 var first="";
	 var second = "";
	 var third = "";
	switch(sMenu)
	{
	case "login":
		first = "登录中心";
		break;
	case "newsandbullet":
		
		$("#img1").attr("src",basePath+"images/error1.gif");
		$("#newsui").show();
		switch(mMenu)
		{
		case "addnews":
			first='发布新闻';
			$("#addnews").addClass("active");
			break;
		case "newsmag":
			first='管理新闻';
			$("#newsmag").addClass("active");
			break;
		case "newsdetail":
			first = "新闻公告详细";
			break;
		}
	     break;
	case "teachermag":
		$("#img2").attr("src",basePath+"images/error1.gif");
		$("#teacherui").show();
		switch(mMenu)
		{
		case "addteachers":
			first="添加教师";
			$("#addtechers").addClass("active");
			break;
		}
		break;
	case "file":
		$("#img3").attr("src",basePath+"images/error1.gif");
		$("#file").show();
		switch(mMenu)
		{
		case "upload":
			first="上传文件";
			$("#upload").addClass("active");
			break;
		case "filemag":
			first="文件管理";
			$("#showfiles").addClass("active");
			break;
		}
		break;
	case "major":
		switch(mMenu)
		{
		case "math":
			first='数学与应用数学';
			$("#math").addClass("active");
			break;
		case "compute":
			first="计算机科学与技术";
			$("#compute").addClass("active");
			break;
		case "infoC":
			first="信息与计算科学";
			$("#infoC").addClass("active");
			break;
		case "software":
			first="软件工程";
			$("#software").addClass("active");
			break;
		}
		break;

	}
    //alert(first + " ----------" + second);
	showPosition(first,second,third);
	function getBookKind(firstid,secondid)
	{
		var sid = $("#sid").val();
		url2 = url + "TraderBook_Book/"+$("#dif").val()+"/"+firstid+"/" + sid+"/1";		
		second = $("#" + firstid).html();	
		third = $("#"+ secondid).html();
		$("#"+ secondid).addClass("active");
	}
	function showPosition(first,second,third)
	{
		var position = "";
		//alert(first);
		if(first=="" || first==null)
		{
			//alert(first + "1");
		      position="当前位置:<font style='color:#990000;font-size:15px;'>首页</font>";	
		}else{
			if(second==null || second=="")
			{
				//alert(first + "2");
				//position = "当前位置:<a href='"+url1+"'>首页</a> >"+"<font style='color:#990000;font-size:15px;'>" +first+"</font>";
				position = "当前位置:<a href='#'>首页</a> >"+"<font style='color:#990000;font-size:15px;'>" +first+"</font>";
				// alert(position);
			}else{
				if(third==null || third=="")
				{
					position = "当前位置:<a href='"+url1+"'>首页</a> > <a href='"+url2+"'>"+first + "</a> > " +"<font style='color:#990000;font-size:15px;'>" +second +"</fon>";
				}else{
					position = "当前位置:<a href='"+url1+"'>首页</a> > "+"<a href='"+kindurl+"'>图书分类</a> > " +"<a href='"+url2+"'>" + second+"</a> > "+"<font style='color:#990000;font-size:15px;'>"+ third +"</font>" ;
				}
			}
		}
		//alert(position);
		$("#position").html(position);
	//	alert($("#position").html());
	}
	
});
